//
//  NewsDetailViewController.m
//  WangI
//
//  Created by dllo on 15/11/25.
//  Copyright © 2015年 WJN. All rights reserved.
//

#import "NewsDetailViewController.h"

@interface NewsDetailViewController ()

@end

@implementation NewsDetailViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 20, self.view.frame.size.width, self.view.frame.size.height)];
    [self.view addSubview:webView];
    webView.scalesPageToFit = YES;
    if ([self.type isEqualToString:@"头条"]) {
        NSString *URLString = [NSString stringWithFormat:@"http://3g.163.com/ntes/special/0034073A/wechat_article.html?docid=%@&spst=0&spss=newsapp&spsf=qq&spsw=1", self.ids];
        NSURL *url = [NSURL URLWithString:URLString];
        NSURLRequest *request = [NSURLRequest requestWithURL:url];
        [webView loadRequest:request];
    } else if ([self.type isEqualToString:@"娱乐"]) {
        NSURL *url = [NSURL URLWithString:self.ids];
        NSURLRequest *request = [NSURLRequest requestWithURL:url];
        [webView loadRequest:request];
    } else if ([self.type isEqualToString:@"热点"]) {
        NSString *URLString = [NSString stringWithFormat:@"http://3g.163.com/ntes/special/0034073A/wechat_article.html?docid=%@&spst=0&spss=newsapp&spsf=qq&spsw=1", self.ids];
        NSURL *url = [NSURL URLWithString:URLString];
        NSLog(@"%@", url);
        NSURLRequest *request = [NSURLRequest requestWithURL:url];
        [webView loadRequest:request];
    }
    
    // Do any additional setup after loading the view.
}







- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
